package com.piece.module.file.util.pdf;

import lombok.Data;

/**
 * pdf基础信息
 **/
@Data
public class BuilderContext {

    /**
     * logo图片
     */
    private byte[] logo;

    /**
     * logo文字
     */
    private String logoText;

    /**
     * 印章图片
     */
    private byte[] stamper;

    /**
     * 印章位置关键词
     */
    private String stamperKey;

    /**
     * 印章所在页
     * -1：所有页
     * 0： 最后页
     */
    private int stamperPage;

    private int stamperSizeX = 200;

    private int stamperSizeY = 200;

    private int stamperOffsetX = -100;

    private int stamperOffsetY = -100;

    /**
     * 背景图片
     */
    private byte[] background;

    /**
     * 水印字符
     */
    private String waterMark;

    /**
     * 二维码位置关键词
     */
    private String tdcKey;

    /**
     * 二维码字符
     */
    private String tdcMark;

    /**
     * 二维码所在页
     * -1：所有页
     * 0： 最后页
     */
    private int tdcPage;

    private int tdcSizeX = 200;

    private int tdcSizeY = 200;

    private int tdcOffsetX = -100;

    private int tdcOffsetY = -100;

    /**
     * 字体类型
     */
    protected String fontType;

    /**
     * 字体路径
     */
    protected String fontPath = "font/simsun.ttc";

    /**
     * pdf报告密码
     */
    private String pdfPassword;

    /**
     * 封面设置 0-没有封面 1-有封面
     */
    private Integer cover = 0;

    /**
     * 是否显示页头
     */
    private boolean showHeader = true;

    /**
     * 是否显示页头页脚
     */
    private boolean showFooter = true;

    public BuilderContext() {
    }

    public void setStamperSizeX(int stamperSizeX) {
        this.stamperSizeX = stamperSizeX;
        this.stamperOffsetX = -stamperSizeX/2;
    }

    public void setStamperSizeY(int stamperSizeY) {
        this.stamperSizeY = stamperSizeY;
        this.stamperOffsetY = -stamperSizeY/2;
    }

    public void setStamperOffsetX(int stamperOffsetX) {
        this.stamperOffsetX = stamperOffsetX;
    }

    public void setStamperOffsetY(int stamperOffsetY) {
        this.stamperOffsetY = stamperOffsetY;
    }
}
